package com.fastloan.core.task;

import com.fastloan.mgt.postloan.service.ZyPostLoanMonitorService;
import com.fastloan.mgt.invest.weixin.core.WeixinMessage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * Created by gelon on 2017/11/16.
 * 定时任务
 */
@Component
public class TimeTask {

    @Autowired
    private ZyPostLoanMonitorService zyPostLoanMonitorService;

    private static final Logger logger = LoggerFactory.getLogger(WeixinMessage.class);

    /**
     * 定时任务添加进件贷后监控实施
     */
    @Scheduled(cron = "0 0 3 * * ?")
    public void scanLoanByApplication() {
        logger.debug("定时任务添加进件贷后监控实施开始");
        long beginTime = System.currentTimeMillis();
        zyPostLoanMonitorService.scanLoanByApplication();
        logger.debug("定时任务添加进件贷后监控实施完成,耗时:" + (System.currentTimeMillis() - beginTime) + "毫秒");
    }

//    /**
//     * 每天十点提醒还款任务到期3天以内的客户还款
//     */
//    @Scheduled(cron = "0 0 10 * * ?")
//    public void dueRepayment() {
//        tapPlicationRepaymentPlanServer.queryRepaymentPlan();
//    }


}
